


var api = require('../../utils/api.js');
var app = getApp();


Page({

    /**
     * 页面的初始数据
     */
    data: {
        quyu:[],
        title:'全部数据',
        id:''
    },

    /**
     * 生命周期函数--监听页面加载 getallquyu
     */
    onLoad(options) {
        var that=this;
        api.post({
            url: 'boss/getallquyu',
            data: {},
            success: data => {
               console.log(data);
                that.setData({
                    quyu:data.data
                })

            }
        });

        this.getallcompany();
    },

    getallcompany(){

        var that=this;
        var id=this.data.id;

        api.post({
            url: 'boss/getallcompany',
            data: {id:id},
            success: data => {
               console.log(data);
                that.setData({
                    info:data.data
                })

            }
        });


    },



    bindPickerChange(ret){
        console.log(ret);
        var i=ret.detail.value;
        var arr=this.data.quyu;


        this.setData({
            title:arr[i].text,
            id:arr[i].id,
        })

        this.getallcompany();
    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

    },

})